Loading...
 

ObjectListView, OListView

ObjectListView, OListView, OLView

ObjectListView(name~aliasName, flags, x, y, w, h)

Parameters
Parameters Description
name * Identifier or CLASS::expr
aliasName an additional identifier
flags Flags
x * Position X (in minicells)
y * Position Y (in Minicells)
w * Width (in minicells)
h * Height (in minicells)
  • - Required parameter

The tuple (class, access expression) defines an image on model data (see FillWindow, DrainWindow). As with every ObjektBox, relations between objects can be displayed and edited interactively.

An ObjectListView is similar in functionality and appearance to the ObjectList. While the ObjectList displays a collection as a list (listbox), as it was available in every Windows version (and accordingly on other platforms), the ObjectListView uses the more modern and further variable ListView box, as it was introduced with Windows 95 in the file explorer.

Asynchrony

Another important difference to other ObjectBoxes is that the ListView evaluates the column formats of the rows to be displayed (asynchronously) only when these rows are visible. This means that some formats are only evaluated when scrolling. Of course, this also has the consequence that the InstantView state (such as the plug space or currency tables) are potentially no longer logged in during the execution of FillObox at the time of evaluation and possibly the transaction has already been closed and the formats are evaluated in a separate transaction. If this behaviour leads to undesirable side effects, synchronous evaluation can be forced via RetrieveData .

Attention!
If a list is only one line high, and if this line is smaller than a standard character of the selected font, the line height is reduced to 2 pixels, making the entry hardly visible.

Example for clarification (pay attention to the height indicated at the very end of the line)
Does not bring a visible entry to FillWindow, because the list is not high enough:

ObjectListView(CX_TRANSACTION::monitors, NO_COLUMNHEADER, AUTO_POSITION, NO_DRAIN, BITMAP_SIZE, ENTIRE, 350, 33, 230, 9)

The font then fits into the list and the line is displayed:

ObjectListView(CX_TRANSACTION::monitors, NO_COLUMNHEADER, AUTO_POSITION, NO_DRAIN, BITMAP_SIZE, ENTIRE, 350, 33, 230, 10)

For the layouting of the ListView in MorphIT there is an additional special rule.
If the ListView is attached to the containing group by a vertical STRETCH, then the ListView is always at least high enough to display all entries without scrolling.
The height of the group then depends on the height of the ListView (specified group height is ignored) and the height specified in the ListView is interpreted as the minimum height of the ListView.

There are typical patterns of how the data is formatted in a ListView.

Header:
This also offers an integrated display of column headers, which can also be accessed via the InstantView® interface using the (pseudo) widget header.
To use it, the identifier of the ObjectListView is passed to the header widget (see help text header) as a parameter. The prompts and buttons as subordinate widgets of the header are then copied into the integrated header of the ObjectListView (the originals should be made invisible via the HIDDEN flag), buttons always represent column headers by which the respective column can be sorted by pressing them.
Repeated actuation of a sorting column header reverses or cancels the sorting orientation. If a column header is pressed and held down -key is pressed, the respective column is added to the previous sorting and thus forms a multiple sorting.
The sorting is visualised (arrows). Second, third etc. Sorting criteria are accordingly indicated by two, three, etc. arrows. A sorting defined with SetSort is visualised in exactly the same way. If a sort is set (with SetSort) but not activated(not called Sort ), it is visualised by deactivated (grey) arrows. Such a deactivated sorting can be activated by pressing with held -key to a column header that belongs to the sort. Under certain conditions (already activated sort is set again (identical) with SetSort, list does not contain more than one element) the ObjectListView detects that the sort is active although Sort has not been called explicitly.
Regardless of the sort order, the SELECT sections of the corresponding widgets in the (InstantView®) header are first called up when the column headers are clicked. If an ObjectListView has been adapted from an ObjectList, it must be ensured that any existing sorting mechanisms are commented out in these SELECT reactions. If cancel in (better at the end) of the SELECT implementation is called, the automatic sorting is omitted. A SELECT at a header button exclusively with the statement cancel is therefore an implementation of an integrated column header that is not sorted.
Columns can be re-sorted by dragging and dropping on the column headers. (This drag and drop is not to be confused with InstantView® dragand drop. No intervention options, such as messages, are supported). Each column retains its original format list number. A SetSort with this number therefore always sorts the same column, no matter how far the columns are re-sorted.

If the mouse cursor reaches the area between 2 column headers (column) it changes into a vertical line with 2 horizontal arrows. When this happens you can change the width of the column header to the left of the cursor by moving the cursor to the left or right while holding down the left mouse button. If you double click in this position, the left column will be made exactly as wide as the widest column element, regardless of the flag AUTO_POSITION (see below).
With this double click or dragging the column width, the automatic calculation of the column width of the affected column is switched on or off at AUTO_POSITION.

Formatting, presentation and interaction:
While in the ObjectList column elements with the same column number (set in SetFormat via COLUMN flag) are simply displayed one above the other, in the ObjectListView all these column elements are merged. First the contained bitmaps are filtered and the first of them (after Formatlist) is displayed before the text on the left side of the column cell. All further bitmaps expire. The text entries are mergedinto a string (separatedby ' ' ()) and displayed on the right. The first format decides whether the text is left- and right-aligned.

As a pure basic Windows object, the ListView box on which it is based follows the general properties of the Windows interface. This means that in particular the marking of elements by clicking on them is fundamentally different from the ObjectList: whole areas can be selectedwith the - and -key. Without any key, clicking on an element will always first cancel all existing selections and then select the element under the mouse cursor.

If the ObjectListView (active) is sorted, you can navigate in the first column of the sort criterion by pressing letter keys. Here letters typed in short succession are understood as a (partial) string and searched for this string in the column. The column elements are also converted into strings internally. An attempt to find an element by partially entering this text will fail if the column is sorted, but entries in the column elements are not sorted.
An example of this is a column with date fields: the dates "3.8.99", "12.9.99" are sorted by date in this order, as pure (uninterpreted) strings, but if '1' came before '3', they would not be sorted. If a letter navigation fails, an element is selected that may have nothing to do with the text entered. There is no error message.
Right-alignment is taken into account and does not lead to incorrect behaviour even when mixed with left-alignment alone.

Bitmaps that are to be displayed in an ObjectListView may have a maximum of 256 colours and must have a palette. This can be realised with the graphic formats.PNG, .BMP, .GIF and .TIF.

virtual list:
Besides the pure display, the ObjectListView differs in the way it reads and processes the data to be displayed. Thus it is possible to make very large amounts of data visible and accessible in a relatively short time. For this purpose it uses a feature of the ListView box, the so-called Virtual List:
While the listbox in the ObjectList includes all data at the beginning (after initializing), transforms it completely into its visual representation and stores it there, the ObjectListView tries to keep this effort as low as possible. For this purpose only the references to the objects concerned are stored in an internal table from the source (e.g. access printout to a collection). Only when certain areas of the list are requested by the user interface, the visual representations for the objects concerned are created and reported back to the user interface.
This means that the visual representations are of course not available (for all) objects at runtime, or are created in an initially unpredictable order, independent of the import sequence of the object references. (Once visual representations have been created, they are stored temporarily to save time and are only recreated under certain conditions). This has several implications when using the ObjectListView:

  • Sorting (e.g. with FillObox and Sort) is done directly via the objects, i.e., if possible, via an access printout. Only if sorting attributes are specified via push statements (see SetFormat) or sorted via the index of the format list (number of the SetFormat statement; see SetSort), the ObjectListView must create visual representations for all objects.
    Therefore the best performance when sorting (exactly the other way round to the behaviour of the ObjectList) is achieved, if the sorting is always done by access expressions and not by format list indices. When pressing the integrated headers (see above), the system always tries to generate an access expression for the column in question and to sort accordingly using this expression.
  • When implementing (non-primitive) push statements, it must be ensured that their result depends exclusively on the state of the respective object and is therefore autonomous from any system states. For example, a call number for each call of the statement must fail.

DrainWindow:
While FillWindow only touches the objects that are displayed on the screen, DrainWindow touches all objects. With many objects this process can take some time. Therefore: DrainWindow should not be used with ListViews that could hold many objects (because the application requires or allows this). ListViews that will only display a few objects can be read out using DrainWindow.

The Object User Box is programmed with the following instructions (identical to the instructions for ObjectList):

The Widget command places an ObjectListView on the stack so that the methods and attributes of a widget can be accessed.

The following methods are offered by the ObjectListView:

Flags
Flag Description
ACCEPT_DROP Objects dragged over the screen from another object box can be placed in the object box with drag-and-drop. What to do with the objects must be described in the action list (see example).
CAR_POSITION The X-positions are calculated automatically, so they do not have to be explicitly specified with SetFormat . Unlike in the ObjectList, only the objects that are currently visible are reliably visualised. Therefore AUTO_POSITION determines the column entry with the longest text only over this area. (plus bitmap width plus width distance bitmap/text, if a bitmap is displayed) This leads to the unsightly effect that the column widths constantly change while scrolling. To avoid this, the column width must be frozen after AUTO_POSITION.
CONTEXTMENU(identifier) The identifier is an identifier of an item within a Menu or ContextMenuList declaration. The submenu hanging under this item is shown automatically when the right mouse button is pressed. If thereupon a menu item is selected the respective action is started as described for item, in the same way as if the menu item had been called from the main menu.
Additionally you can get the menu item via ContextMenu from which window object the menu item was called via ContextMenu when you execute SELECT for the corresponding item with GetCurrentWidget. With a call from the main menu GetCurrentWidget returns NULL.

If a ContextMenu should not appear automatically, then it can be called (according to design guidelines this should be done as reaction to the right mouse button, thus within MOUSE_CLICK_R ) by means of PopupMenu also from InstantView®. In this case you should not use the CONTEXTMENU flag, otherwise the menu will appear twice (once automatically, once controlled).

GRIDMENU(identifier) Sets the grid menu . The identifier is an identifier of an item within a Menu or ContextMenuList declaration.
DRAG_COPY The currently selected objects can be dragged to another object box or to a window with the right mouse button (drag and drop). The objects can only be dropped on a target with flag ACCEPT_DROP. The list box entries are retained.
DRAG_MOVE As with DRAG_COPY, the currently selected objects can be dragged to another object box or to a window. The corresponding list box entries are deleted if the objects have been placed in another list box or window with the flag ACCEPT_DROP.
HELP(anchor) Help("file#anchor") connects the window object with online help in HTML format. If no file name is specified, the HTML file specified in the module applies.
HIDDEN The object box remains invisible until the Show instruction makes it appear on the screen.
HZ_SCROLL_BAR In addition to the vertical scrollbar, the object box also has a horizontal scrollbar.
ITEM(w, h), ITEM(w), ITEM(, h) If the width and height of a list box entry deviate from the dimensions specified by the size of the list box, they are indicated in this way. A larger width is useful together with flag HZ_SCROLL_BAR. Multi-line entries require an explicit height specification.
LIST_INVALID (from 4.2) Normally, only valid objects are added to an Object User Box. However, when this flag is set, invalid objects are also included and displayed.
LIST_ORIGIN If an invalid object is inserted into a ListView and there is a valid exchange object, the valid exchange object is normally included. This flag prevents this so that only the valid original object is included. The interaction with LIST_INVALID is explained in more detail below.
MIN_HEIGHT(h) The height of the list is never less than the value h (given in minicells). This is especially useful in combination with attachments.
MIN_WIDTH(w) width of the list does not fall below the value w (specified in minicells). This is especially useful in combination with attachments.
NO_COLUMNHEADER No column descriptions are displayed.
NO_FORMAT_FILTER 194900 Objects that cannot be displayed due to the specified format are not sorted out.
NO_SORTHEADER The column headers are not displayed as buttons, so the list cannot be sorted by pressing a button on a column header. But you can still change the column width and move columns.
OPTIMIZE The optimisation refers to the access expressions for the columns of the list (compare statement SetFormat): identical partial expressions are evaluated only once(further notes ...).
SELECT_MULTIPLE It is possible to select several objects simultaneously (only for listboxes!).
TOOLTIP(mlString) The specified string is displayed as a tooltip or, if an event TOOLTIP is also defined, is passed to it. The tooltip is automatically triggered by the system after a certain period of time when the mouse cursor remains over the window object. The string can be multilingual. The current language is passed to the event.

Transaction cancellation

If a transaction is aborted (AbortTXN, Attention(AbortTXN), etc.) the ListView is emptied - but only if it was changed within the transaction. This ensures that the ListView does not contain any objects that may no longer exist (e.g. new persistent objects that are deleted by the transaction termination).

Interaction LIST_INVALID with LIST_ORIGIN

Without flags only valid objects are included, in case of invalid objects the valid exchange object. LIST_INVALID allows to include invalid objects, LIST_ORIGIN includes only the original object, not the exchange object:

Flags / Object g ug u
- g g -
LIST_INVALID g g u
LIST_ORIGIN g - -
LIST_INVALID+LIST_ORIGIN g u u

g = valid object,
ug = invalid object with valid exchange object,
u = invalid object

Attention!
When combining LIST_INVALID with LIST_ORIGIN, the original object is always included in the list, even if the exchange object is valid. This is e.g. placed on the stack when double-clicking or using the GetObject command, i.e. there might be an invalid object on the stack for which there is a valid exchange object - this is unusual in ClassiX®! If you want to work with the valid exchange object, a "this. in front, e.g. "this.uniqueID".

Quick list

The combination of LIST_INVALID, LIST_ORIGIN and NO_FORMAT_FILTER deactivates all checking routines which cause data traffic. If sorting is also dispensed with, or used to a limited extent, the list is displayed many times faster because less data has to be transmitted. However, it depends on the application case whether, for example, a list without sorting or a list without valid exchange objects is helpful for the user.